Repository navigation
Pin Helios execution and RoCE proxy threads to high-capacity CPUs on asymmetric Linux topologies - #576
Pin Helios execution and RoCE proxy threads to high-capacity CPUs on asymmetric Linux topologies#576fordbmorris wants to merge 1 commit into
Conversation
3363573 to
4b41ddc
Compare
|
A case file has been opened for 576. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe DGX Spark placement work is well-targeted and preserves operator cpusets, but two concrete defects block merge: a vendored
Have your agent review the Full Review for complete verified findings, To opt out, include |
original-el8
left a comment
There was a problem hiding this comment.
Pinning critical execution threads to high-capacity CPUs on asymmetric ARM64 hosts addresses a real throughput and jitter problem on GB10, and the eos/src/unix.rs tier-selection logic cleanly respects operator cpusets and no-ops on homogeneous or x86_64 systems. Two blockers need resolution before merge:
- Child-thread affinity inheritance in
helios/src/server/runtime.rs:565: Callingflare_eos::prefer_high_capacity_cpus()at entry to theflare-modelthread runs beforeRankExecutor::new,crate::offload::open(host prefix offload, codec, and disk threads), andImagePreparation::new(helios/src/server/runtime.rs:682-725). On Linux, spawned child threads inherit their parent's affinity mask, so background offload, disk, and image-preparation threads inherit the Cortex-X925-only mask instead of remaining free to run on efficiency cores. Move theprefer_high_capacity_cpus()call inflare-modelto right beforeworker.run(&mut executor)(and verifyhelios/src/execution/parallel.rs:536does not narrow affinity before spawning non-critical helper threads). - Vendored
helios/native/roce_proxy.cfork and duplicate C logic (helios/native/roce_proxy.c:186-258):helios/native/roce_proxy.cmust remain identical to FlashInfer's pinnedflashinfer/experimental/b12x/comm/roce/_roce_proxy.c(lines 6-8), and this duplicates 66 lines of untested C capacity-selection logic alongsideeos/src/unix.rs. Either sync the change through FlashInfer PR #156 first, or applyflare_eos::prefer_high_capacity_cpus()from Rust around proxy thread creation without modifying the vendored C file. - Commit message and sign-off hygiene: Update the commit message so it matches the PR description (the commit message still states 6-launch and serving runs "follow immediately"), include the reviewing model identity in
Design-Signed-Off-By(Antigravityomits the model), and refresh thedocs/design-review.mddigest (eb2fis stale onmain).
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe core tier-selection helper is sound, but editing vendored
Walkthrough
Merge Risk: High · up to
|
4b41ddc to
4c82ab5
Compare
|
Thanks @original-el8 for the thorough review. Rebased onto current
Ready for re-review! |
…asymmetric Linux topologies
On asymmetric ARM64 Linux SoCs such as NVIDIA GB10 (10 Cortex-A725
efficiency cores with sysfs cpu_capacity 718..731 alongside 10
Cortex-X925 performance cores with cpu_capacity 997..1024), the Linux
scheduler places Helios's execution threads and the busy-polling RoCE
proxy thread onto efficiency cores on some launches and performance cores
on others. Efficiency-core placement slows one-shot RoCE collectives,
inflates inter-graph host wake gaps, and creates launch-to-launch
throughput jitter that distorts speculative drafting choices.
Changes:
- Add flare_eos::select_high_capacity_cpus and prefer_high_capacity_cpus
in eos/src/unix.rs (with a no-op stub in eos/src/windows.rs and unit
tests in eos/src/unix.rs). On Linux, prefer_high_capacity_cpus reads
/sys/devices/system/cpu/cpu<N>/cpu_capacity across the thread's current
sched_getaffinity mask, selects CPUs at or above 90% of the maximum
allowed capacity (falling back above midpoint so busy threads never
collapse onto fewer than two cores), and no-ops when cpu_capacity is
absent, homogeneous, or already single-tier.
- Call flare_eos::prefer_high_capacity_cpus() in Helios critical worker
threads after child-thread spawning so background threads keep the full
process affinity mask:
- helios/src/server/runtime.rs (flare-model): called after
RankExecutor::new, crate::offload::open (host prefix offload, KV
codec pool, and disk threads), and ImagePreparation::new, immediately
before worker.run(&mut executor).
- helios/src/execution/worker.rs (flare-execution): called after
RankExecutor::new.
- helios/src/execution/threaded.rs (flare-rank-*): called after
GraphExecutor::new_unstarted.
- helios/src/execution/parallel.rs (serve_rank): called after
GraphExecutor::new_unstarted (no non-critical helper threads are
spawned in serve_rank).
- helios/src/replay.rs (flare-cuda): called on worker entry before the
replay loop.
- helios/native/roce_proxy.c: vendor the exact pin_high_capacity_cpus()
and flare-roce thread-naming change merged in
local-inference-lab/flashinfer#156 (commit 335459b2). Existing core
ABIs and operator cpusets remain unchanged.
Measured benefit on four DGX Spark GB10 nodes (--roce-ring, Inkling 2
Small NVFP4 TP4 core gb10-tp4-202611271425):
- Across 6 consecutive launches, 48/48 critical threads stayed on
Cortex-X925 (vs 4/4 unpinned launches landing on Cortex-A725).
- Batch=1 width=8 graph-time CV dropped 6.7x (4.82% to 0.72%); controlled
A/B C8 64k decode rose 17.2% (123.66 to 144.88 tok/s); 8k-128k cold
prefill rose 2.6%-17.3%.
- Node-level nsys showed C1 width-1 RoceOneshotLaunch dropped 31.0%
(2.77 to 1.91 ms) and p90 inter-graph host wake gap dropped 61x
(1,880 to 30.9 us).
Validation and limitations:
- ARM64 Linux (dgx2): cargo test --locked --release --manifest-path
eos/Cargo.toml passed 5/5 (including asymmetric, homogeneous,
single-tier, zero-capacity, and three-tier unit tests); cargo test
--locked --release --manifest-path helios/Cargo.toml --features
roce,runtime-core,server passed 1,728/1,728 (44 GPU-only ignored),
including all 6 execution::roce::tests.
- Live four-Spark serving via flare run on existing ABI-14 core
gb10-tp4-202611271425 succeeded (60.0 tok/s short, 79.4 tok/s coding,
0/16 ConnectX-7 port errors, clean Orbit drain). Inspecting
/proc/<pid>/task/*/status across all four ranks confirmed flare-model,
flare-roce, and peer serve_rank threads had Cpus_allowed_list=5-9,15-19
while the ImagePreparation child thread spawned by flare-model,
flare-http, tokio-rt-worker, and CUDA helper threads kept 0-19.
- Limitations: tested on ARM64 Linux (NVIDIA GB10, schedutil); on x86_64
Linux sysfs cpu_capacity is absent so the helper is a no-op; the
eos/src/windows.rs stub was not compiled on Windows; host prefix
offload with --prefix-cache-memory was not exercised on multi-host TP4
(verified by placement order after crate::offload::open).
Design-Signed-Off-By: Antigravity (Gemini-4-Neon); design-review=2e5b
Signed-off-by: woooflet <ford@fordmorris.com>
4c82ab5 to
ba2796c
Compare
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe rework clears two of the three prior blockers —
Walkthrough
Merge Risk: Medium · up to
|
Why
On asymmetric ARM64 Linux SoCs such as NVIDIA GB10 (DGX Spark: 10 Cortex-A725 efficiency cores with sysfs
cpu_capacity718–731 alongside 10 Cortex-X925 performance cores withcpu_capacity997–1,024), the Linux scheduler places Helios execution threads and the busy-polling RoCE proxy thread onto efficiency cores on some launches and performance cores on others. Efficiency-core placement slows one-shot RoCE collectives, inflates inter-graph host wake gaps, and creates launch-to-launch timing variance that distorts speculative drafting choices.What Changed
eos/src/unix.rs(+ no-op stub ineos/src/windows.rs): addselect_high_capacity_cpusandprefer_high_capacity_cpus, which intersect strictly with the thread's existingsched_getaffinitymask, read/sys/devices/system/cpu/cpu<N>/cpu_capacity, select CPUs >= 90% of max allowed capacity (falling back above midpoint to never collapse below 2 cores), and no-op whencpu_capacityis absent, homogeneous, or already single-tier.flare_eos::prefer_high_capacity_cpus()in Helios critical worker threads until after child-thread spawning so background threads retain the unnarrowed process affinity mask:helios/src/server/runtime.rs(flare-model): called afterRankExecutor::new,crate::offload::open(host prefix offload, KV codec pool, and disk threads), andImagePreparation::new, right beforeworker.run(&mut executor).helios/src/execution/worker.rs(flare-execution): called afterRankExecutor::new.helios/src/execution/threaded.rs(flare-rank-*): called afterGraphExecutor::new_unstarted.helios/src/execution/parallel.rs(serve_rank): called afterGraphExecutor::new_unstarted(no non-critical helper threads are spawned inserve_rank).helios/src/replay.rs(flare-cuda): called on worker entry before the replay loop.helios/native/roce_proxy.c: vendor the exactpin_high_capacity_cpus()and"flare-roce"thread-naming hunk merged in feat(b12x/comm/roce): pin RoCE proxy thread to high-capacity CPUs on asymmetric Linux topologies local-inference-lab/flashinfer#156 (335459b2). Existing core ABIs and operator cpusets remain unchanged.Claimed Benefit & Supporting Evidence (4× DGX Spark GB10 TP4,
--roce-ring, Inkling 2 Small NVFP4 coregb10-tp4-202611271425)48/48critical threads stayed on Cortex-X925 (vs4/4unpinned launches landing on A725). On the updated binary (4c82ab5b), inspecting/proc/<pid>/task/*/statusacross all four ranks during live serving confirmedflare-model,flare-roce, and peerserve_rankthreads hadCpus_allowed_list=5-9,15-19while theImagePreparationchild thread spawned byflare-model,flare-http,tokio-rt-worker, and CUDA driver helper threads retained0-19.batch=1, width=8graph-time CV dropped 6.7× (4.82% -> 0.72%); controlled A/BC864k decode rose +17.2% (123.66 -> 144.88 tok/s); 8k–128k cold prefill rose+2.6%to+17.3%.nsys: C1 width-1RoceOneshotLaunchdropped -31.0% (2.77 -> 1.91 ms); p90 inter-graph host wake gap dropped 61× (1,880 -> 30.9 us).4c82ab5b):cargo test --locked --release --manifest-path eos/Cargo.toml:5/5passed on ARM64 Linux (dgx2).cargo test --locked --release --manifest-path helios/Cargo.toml --features roce,runtime-core,server:1,728/1,728passed (44GPU-only ignored), including all6execution::roce::tests.flare runon existing ABI-14 coregb10-tp4-202611271425:60.0 tok/sshort,79.4 tok/s256-token coding,0/16ConnectX-7 RDMA port errors, clean Orbit drain.Limitations: Tested on ARM64 Linux (NVIDIA GB10,
schedutil). On x86_64 Linux,/sys/devices/system/cpu/cpu<N>/cpu_capacityis absent so the helper is a no-op.eos/src/windows.rswas not compiled on Windows. Host prefix offload (--prefix-cache-memory) was not exercised on multi-host TP4 and is protected by deferringprefer_high_capacity_cpus()pastcrate::offload::open.Discord: woooflet